package com.example.android_learn;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.format.DateUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import java.text.DateFormat;

public class ButtonStyleActivity extends AppCompatActivity {
    private TextView text_date;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_button_style);
        text_date = findViewById(R.id.text_date_now);
    }

    public void doClick(View view) {
        String desc = String.format("%s 您点击了按钮：%s", DateUtil.getNowTime(), ((Button)view).getText());
        text_date.setText(desc);
    }
}